package view.statique;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;


public class jTableRender extends DefaultTableCellRenderer  {

	private static final long serialVersionUID = 1L;



	@Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        
        String s =  (String) table.getValueAt(row, 2 );
        	if (s.equalsIgnoreCase("1")){
    			component.setBackground(new Color(250, 240, 130));
    		}
    		else if(s.equalsIgnoreCase("2")){
    			component.setBackground(new Color(255, 195, 130));
    		}
    		else{
    			component.setBackground(new Color(255, 150, 150));
    		}
        return component;
    }
}
